﻿using System;
using UnityEngine;

public class Action9202 : GameAction {
    private ActionResult actionResult;

    public Action9202 ( )
        : base(9202) {
    }

    protected override void SendParameter (NetWriter writer, ActionParam actionParam) {

        writer.writeInt32("GameType", actionParam.Get<int>("gameType"));
        writer.writeInt32("ServerID", actionParam.Get<int>("serverID"));
    }

    protected override void DecodePackage (NetReader reader) {
        actionResult = new ActionResult( );

        int subRecordCount = reader.getInt( );
        var subTable = new ActionResult[subRecordCount];
        for (int i = 0; i < subRecordCount; i++) {
            var subRecord = new ActionResult( );
            reader.recordBegin( );
            subRecord["BroadcastType"] = reader.getWORD( );
            subRecord["Content"] = reader.readString( );
            subRecord["PlayTimes"] = reader.getInt( );
            reader.recordEnd( );
            subTable[i] = subRecord;
        }
        actionResult["Children_1"] = subTable;

    }

    public override ActionResult GetResponseData ( ) {
        return actionResult;
    }
}
